#ifndef HALFSPHEREGENERATOR_H_
#define HALFSPHEREGENERATOR_H_

#include "precom.h"
#include <list>

struct Tria {
	fmath::vector3 m_points[3];
	fmath::vector3 m_normals[3];
};

class HalfSphereGenerator
{
private:
	std::list<Tria>				m_sphereTriangles;
	std::list<fmath::vector3>	m_boundList;
	float m_radius, m_height;
protected:
	fmath::vector3 DivLine(fmath::vector3& v1, fmath::vector3& v2) const;
	void DivadeTriangle(Tria& a_tr);
	void CreateHalfOctagon(float a_radius);
	GLuint CompileModel();
	void Generating(float a_radius, float a_height);
public:
	GLuint GenerateSphere(float a_radius, float a_height);
};

#endif //HALFSPHEREGENERATOR_H_